home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 November / EnigmA AMIGA RUN 02 (1995)(G.R. Edizioni)(IT)[!][issue 1995-11][Skylink CD].iso / earcd / util / text / proged1.lha / InstallProgED / SASC_support / Sources / GetSASCOption.c < prev    next >
C/C++ Source or Header  |  1995-06-09  |  641b  |  40 lines

  1.  
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4. #include <string.h>
  5. #include <proto/exec.h>
  6. #include <proto/dos.h>
  7.  
  8. int main(int argc,char *argv[])
  9. {
  10.     FILE            *file;
  11.     short             trovato;
  12.     char            *p,
  13.                  buffer1[200],
  14.                  buffer2[400];
  15.  
  16.  
  17.  
  18.     strcpy(buffer1,argv[1]);
  19.     strcat(buffer1,"=");
  20.  
  21.     if (!(file=fopen("SCOPTIONS","r")))    exit(5);
  22.  
  23.     trovato=FALSE;
  24.     while((!feof(file))&&(!trovato))
  25.     {
  26.         fgets(buffer2,sizeof(buffer2)-1,file);
  27.         if (!strnicmp(buffer1,buffer2,strlen(buffer1)))    trovato=TRUE;
  28.     }
  29.  
  30.     fclose(file);
  31.  
  32.     if (!trovato)    p="";
  33.     else        p=buffer2+strlen(buffer1);
  34.  
  35.     SetVar("OPTION",p,-1,GVF_LOCAL_ONLY);
  36.  
  37.     if (!trovato)    exit(5);
  38.     else        exit(0);
  39. }
  40.